package com.iwhalecloud.citybrain.flow.platform.manager.application.common.command;

import org.flowable.engine.common.impl.interceptor.Command;
import org.flowable.engine.common.impl.interceptor.CommandContext;
import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
import org.flowable.engine.impl.util.CommandContextUtil;

import java.io.Serializable;

/**
 * @author lilh
 * @date 2019-01-30 16:52
 */
public class FindExecutionEntityCmd implements Command<ExecutionEntity>, Serializable {
    private static final long serialVersionUID = -8142342879173599475L;

    private String entityId;

    public FindExecutionEntityCmd(String entityId) {
        this.entityId = entityId;
    }

    @Override
    public ExecutionEntity execute(CommandContext commandContext) {
        return CommandContextUtil.getProcessEngineConfiguration(commandContext).getExecutionDataManager()
                .findById(entityId);
    }
}
